﻿using System;
using AppsGenerator.Generatings;
using DBBuilder;
using AppsGenerator.Models;

namespace AppsGenerator
{
    class Program
    {
        static void Generate()
        {
            var ctx = new DataContext(WebConfiguration.Instance.DataSource, WebConfiguration.Instance.DataBaseName, WebConfiguration.Instance.UserName, WebConfiguration.Instance.Password);
            var db = ctx.InitDBStructure();
            if (db != null)
            {
                var gen = new WebGenerating(ctx.InitDBStructure());
                gen.RequestToGenerate();
            }
            else
            {
                Console.WriteLine("Cannot init DB structure");
            }
        }

        static void Main(string[] args)
        {
            new BootStrapper().InitIoC();
            Generate();
        }
    }
}
